﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text; 

namespace Exhibition.Common.Helper
{
    public static class CommFunMsg
    {
        /// <summary>
        /// 消息分类  A开头为提示信息例如：数据保存成功  H开头为帮助信息 E开头为错误信息 S开头为系统信息
        /// </summary>
        /// <param name="msgNum"></param>
        /// <returns></returns>
        public static string GetMessage(string msgNum,Lan lan)
        {
            string rtn = string.Empty;
            switch (lan) { 
                case Lan.zh:
                     rtn= GetZhMsg(msgNum);
                    break;
                case Lan.en:
                    rtn = GetEnMsg(msgNum);
                    break;
            }
            return rtn;
           

        }

        private static string GetZhMsg(string msgNum) {
            string strRtn = string.Empty;

           
            switch (msgNum.ToLower())
            {
                case "a0001":
                    strRtn = "恭喜你，数据保存成功!";
                    break;
                case "a0002":
                    strRtn = "请选择时间!";
                    break;
                case "a0003":
                    strRtn = "对不起，请输入用户名!";
                    break;
                case "a0004":
                    strRtn = "对不起，请输入密码!";
                    break;
                case "a0005":
                    strRtn = "对不起，用户名或密码错误!";
                    break;
                case "a0006":
                    strRtn = "对不起，登陆超时，请重新登陆!";
                    break;

                case "s0001":
                    strRtn = "对不起请联系管理员设置默认网站!";
                    break;
                case "s0002":
                    strRtn = "对不起，超级管理员不允许删除!"; 
                    break; 
                case "s0003":
                    strRtn = "对不起没有相关的表结构与之对应，请联系管理员！";
                    break;
                case "e0001":
                    strRtn = "对不起，数据保存失败!请联系管理员！";
                    break;
                case "e0002":
                    strRtn = "通用删除出错!";
                    break;
                default:
                    strRtn = msgNum + "没有设置默认的提示信息！";
                    break;
            }
            return strRtn;

        }


        private static string GetEnMsg(string msgNum)
        {
            string strRtn = string.Empty;


            switch (msgNum.ToLower())
            {
                case "a0001":
                    strRtn = "Sussess!";
                    break;
                case "s0001":
                    strRtn = "Sorry Please Contact The Administrator!";
                    break;
                case "e0001":
                    strRtn = "Error Data!";
                    break;
                default:
                    strRtn = msgNum + "No Error Message！";
                    break;
            }
            return strRtn;

        }

    }
}
